package
{
	import flash.events.Event;
	import flash.events.FocusEvent;
	
	import mx.controls.DataGrid;
	import mx.controls.TextInput;
	import mx.core.Application;
	
	public class TextInputRenderer extends TextInput{
		public function TextInputRenderer(){
			super();
			this.addEventListener(Event.CHANGE, onChangeHandler);
			this.addEventListener(FocusEvent.FOCUS_OUT, onFocusOut);
		}
		
		override public function set data(value:Object):void{
			super.data = value;			
		}
		
		protected function onChangeHandler(evt:Event):void{
			var app:Application = this.parentApplication as Application;
			var prp:InputPrompt = app['prp'];
			prp.refreshData(app, this.text);
			prp.visible = true;
			prp.x = this.x;
			prp.y = (this.y + 50);
		}
		
		protected function onFocusOut(evt:Event):void{
			var app:Application = this.parentApplication as Application;
			var prp:InputPrompt = app['prp'];
			if(!prp.oneVisible){
				prp.visible = false;
			}
		}
	}
}